namespace FastNet.Core.Enums;

public enum ResponseCode
{
    ServerError = 1,
    LoginExpiration = 302,
    ParametersLack = 303,
    TokenExpiration,
    PINError,
    NoPermissions,
    NoRolePermissions,
    LoginError,
    AccountLocked,
    LoginSuccess,
    SaveSuccess,
    AuditSuccess,
    OperSuccess,
    RegisterSuccess,
    ModifyPwdSuccess,
    EidtSuccess,
    DelSuccess,
    NoKey,
    NoKeyDel,
    KeyError,
    Other
}
public static class ResponseDescription
{
    public static string GetDescription(this ResponseCode type)
    {
        string msg;
        switch (type)
        {
            case ResponseCode.LoginExpiration:
                msg = "登陆已过期,请重新登陆"; break;
            case ResponseCode.TokenExpiration:
                msg = "Token已过期,请重新登陆"; break;
            case ResponseCode.AccountLocked:
                msg = "帐号已被锁定"; break;
            case ResponseCode.LoginSuccess:
                msg = "登陆成功"; break;
            case ResponseCode.ParametersLack:
                msg = "参数不完整"; break;
            case ResponseCode.NoPermissions:
                msg = "没有权限操作"; break;
            case ResponseCode.NoRolePermissions:
                msg = "角色没有权限操作"; break;
            case ResponseCode.ServerError:
                msg = "服务器好像出了点问题....."; break;
            case ResponseCode.LoginError:
                msg = "用户名或密码错误"; break;
            case ResponseCode.SaveSuccess:
                msg = "保存成功"; break;
            case ResponseCode.NoKey:
                msg = "没有主键不能编辑"; break;
            case ResponseCode.NoKeyDel:
                msg = "没有主键不能删除"; break;
            case ResponseCode.KeyError:
                msg = "主键不正确或没有传入主键"; break;
            case ResponseCode.EidtSuccess:
                msg = "编辑成功"; break;
            case ResponseCode.DelSuccess:
                msg = "删除成功"; break;
            case ResponseCode.RegisterSuccess:
                msg = "注册成功"; break;
            case ResponseCode.AuditSuccess:
                msg = "审核成功"; break;
            case ResponseCode.ModifyPwdSuccess:
                msg = "密码修改成功"; break;
            case ResponseCode.OperSuccess:
                msg = "操作成功"; break;
            case ResponseCode.PINError:
                msg = "验证码不正确"; break;

            default: msg = type.ToString(); break;
        }
        return msg;
    }
}
